import Mock from 'mockjs';

const {mock} = Mock;

// 获取系统配置列表
mock("/api/system/config", "get", {
    code: 200,
    data: {
        total: 10,
        list: [
            {
                id: "1",
                configName: "系统名称",
                configKey: "sys.name",
                configValue: "V3 Admin",
                configType: "Y",
                status: "0",
                remark: "系统名称",
                createdTime: "2024-01-01 10:00:00",
                createdBy: "admin",
                updatedTime: "2024-01-01 10:00:00",
                updatedBy: "admin"
            },
            {
                id: "2",
                configName: "系统版本",
                configKey: "sys.version",
                configValue: "1.0.0",
                configType: "Y",
                status: "0",
                remark: "系统版本号",
                createdTime: "2024-01-01 10:00:00",
                createdBy: "admin",
                updatedTime: "2024-01-01 10:00:00",
                updatedBy: "admin"
            },
            {
                id: "3",
                configName: "上传文件大小限制",
                configKey: "sys.upload.maxSize",
                configValue: "50",
                configType: "Y",
                status: "0",
                remark: "上传文件大小限制（MB）",
                createdTime: "2024-01-01 10:00:00",
                createdBy: "admin",
                updatedTime: "2024-01-01 10:00:00",
                updatedBy: "admin"
            },
            {
                id: "4",
                configName: "允许上传的文件类型",
                configKey: "sys.upload.allowTypes",
                configValue: "jpg,jpeg,png,gif,doc,docx,xls,xlsx,zip,rar",
                configType: "Y",
                status: "0",
                remark: "允许上传的文件类型",
                createdTime: "2024-01-01 10:00:00",
                createdBy: "admin",
                updatedTime: "2024-01-01 10:00:00",
                updatedBy: "admin"
            },
            {
                id: "5",
                configName: "系统默认密码",
                configKey: "sys.user.initPassword",
                configValue: "123456",
                configType: "Y",
                status: "0",
                remark: "新用户默认密码",
                createdTime: "2024-01-01 10:00:00",
                createdBy: "admin",
                updatedTime: "2024-01-01 10:00:00",
                updatedBy: "admin"
            },
            {
                id: "6",
                configName: "系统默认头像",
                configKey: "sys.user.defaultAvatar",
                configValue: "/avatar/default.jpg",
                configType: "Y",
                status: "0",
                remark: "用户默认头像",
                createdTime: "2024-01-01 10:00:00",
                createdBy: "admin",
                updatedTime: "2024-01-01 10:00:00",
                updatedBy: "admin"
            },
            {
                id: "7",
                configName: "系统默认主题",
                configKey: "sys.theme.default",
                configValue: "light",
                configType: "Y",
                status: "0",
                remark: "系统默认主题",
                createdTime: "2024-01-01 10:00:00",
                createdBy: "admin",
                updatedTime: "2024-01-01 10:00:00",
                updatedBy: "admin"
            },
            {
                id: "8",
                configName: "系统默认语言",
                configKey: "sys.language.default",
                configValue: "zh-CN",
                configType: "Y",
                status: "0",
                remark: "系统默认语言",
                createdTime: "2024-01-01 10:00:00",
                createdBy: "admin",
                updatedTime: "2024-01-01 10:00:00",
                updatedBy: "admin"
            },
            {
                id: "9",
                configName: "系统默认时区",
                configKey: "sys.timezone.default",
                configValue: "Asia/Shanghai",
                configType: "Y",
                status: "0",
                remark: "系统默认时区",
                createdTime: "2024-01-01 10:00:00",
                createdBy: "admin",
                updatedTime: "2024-01-01 10:00:00",
                updatedBy: "admin"
            },
            {
                id: "10",
                configName: "系统默认分页大小",
                configKey: "sys.pageSize.default",
                configValue: "10",
                configType: "Y",
                status: "0",
                remark: "系统默认分页大小",
                createdTime: "2024-01-01 10:00:00",
                createdBy: "admin",
                updatedTime: "2024-01-01 10:00:00",
                updatedBy: "admin"
            }
        ]
    }
});

// 添加系统配置
mock("/api/system/config", "post", {
    code: 200,
    data: {
        id: Mock.Random.id(),
        message: "添加成功"
    }
});

// 更新系统配置
mock("/api/system/config", "put", {
    code: 200,
    data: {
        message: "更新成功"
    }
});

// 删除系统配置
mock("/api/system/config", "delete", {
    code: 200,
    data: {
        message: "删除成功"
    }
}); 